package com.gitee.leo.demo.wx.mp.common.handlers;

import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class UnsubscribeHandler extends AbstractHandler{
    @Override
    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMpXmlMessage, Map<String, Object> map, WxMpService wxMpService, WxSessionManager wxSessionManager) throws WxErrorException {
        String openId = wxMpXmlMessage.getFromUser();
        String appId = wxMpXmlMessage.getAuthorizeAppId();
        String outerStr = wxMpXmlMessage.getOuterStr();
        logger.info("\n关注的新用户：[{}, {}, {}]", openId,
                appId, outerStr);
        String msg = "您好，感谢关注诺华E时代，tag="+appId+"@@@"+openId + "@@@"+ outerStr +"，<a href='https://www.baidu.com' >"+"请点击这里进行身份认证</a>";
        return null;
    }
}
